package com.hundsun.cprs.yyt.web.vo.excel;

import java.util.Date;

import com.hundsun.cprs.yyt.service.trade.domain.TradeEntrust;
import com.hundsun.cprs.yyt.service.trade.enums.EnumTradeEntrustStatus;
import com.hundsun.cprs.yyt.service.trade.enums.EnumTradeStatus;
import com.hundsun.cprs.yyt.util.MoneyUtils;

/**
 * 导出的委托列表字段
 * @author linrl
 * @date 2019年4月9日
 */
public class TradeEntrustExportVo {
    
    /**
     * 委托编号
     */
    private Long entrustNo;

    /**
     * 关联订单编号
     */
    private String orderSn;

    /**
     * 新老会员委托标签
     *
     * */
    private String entrustTagDesc;

    /**
     * 用户姓名
     */
    private String userName;

    /**
     * 资金账号
     */
    private String fundAccount;

    /**
     * 商品代码
     */
    private String goodsCode;

    /**
     * 委托价格
     */
    private String entrustPrice;
    
    /**
     * 委托数量
     */
    private Long entrustAmount;

    /**
     * 委托大类状态 {@link EnumTradeStatus}
     */
    private String statusDesc;

    /**
     * 上报时间
     */
    private Date entrustTime;
    
    /**
     * 已成数量：卖为负，买为正
     */
    private Long businessAmount;
    
    /** 
     * 资金已支出或已收入(卖为正数，买为负数)
     */
    private String businessFund;

    /**
     * 盈利金额：买为0，卖为[匹配价格-委卖价格]*N - 佣金 - 综合管理费]
     */
    private String gainBusinessFund;
    
    /**
     * 综合管理费
     */
    private String managementFund;
    
    /**
     * 手续费
     */
    private String commissionFund;
    
    /**
     * 收入金额
     */
    private String totalBusinessFund;
    
    
    public TradeEntrustExportVo(TradeEntrust entrust){
        this.entrustNo = entrust.getEntrustNo();
        this.orderSn = entrust.getOrderSn();
        this.entrustTagDesc = entrust.getEntrustTag()==1?"老":"新";
        this.userName = entrust.getUserName();
        this.fundAccount = entrust.getFundAccount();
        this.goodsCode = entrust.getGoodsCode();
        this.entrustPrice = MoneyUtils.getMoneyFormatFen(entrust.getEntrustPrice());
        this.entrustAmount = entrust.getEntrustAmount();
        this.statusDesc = EnumTradeStatus.indexByValue(entrust.getStatus()).getDesc();
        this.businessAmount = Math.abs(entrust.getBusinessAmount());
        this.businessFund = MoneyUtils.getMoneyFormatFen(entrust.getBusinessFund());
        this.gainBusinessFund = MoneyUtils.getMoneyFormatFen(entrust.getGainBusinessFund());
        this.managementFund = MoneyUtils.getMoneyFormatFen(entrust.getManagementFund());
        this.commissionFund = MoneyUtils.getMoneyFormatFen(entrust.getCommissionFund());
        this.totalBusinessFund = MoneyUtils.getMoneyFormatFen(entrust.getTotalBusinessFund());
        this.entrustTime = entrust.getEntrustTime();
    }

    public Long getEntrustNo() {
        return entrustNo;
    }

    public void setEntrustNo(Long entrustNo) {
        this.entrustNo = entrustNo;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getFundAccount() {
        return fundAccount;
    }

    public void setFundAccount(String fundAccount) {
        this.fundAccount = fundAccount;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public Long getEntrustAmount() {
        return entrustAmount;
    }

    public void setEntrustAmount(Long entrustAmount) {
        this.entrustAmount = entrustAmount;
    }

    public Date getEntrustTime() {
        return entrustTime;
    }

    public void setEntrustTime(Date entrustTime) {
        this.entrustTime = entrustTime;
    }

    public Long getBusinessAmount() {
        return businessAmount;
    }

    public void setBusinessAmount(Long businessAmount) {
        this.businessAmount = businessAmount;
    }

    public String getEntrustPrice() {
        return entrustPrice;
    }

    public void setEntrustPrice(String entrustPrice) {
        this.entrustPrice = entrustPrice;
    }

    public String getStatusDesc() {
        return statusDesc;
    }

    public void setStatusDesc(String statusDesc) {
        this.statusDesc = statusDesc;
    }

    public String getGainBusinessFund() {
        return gainBusinessFund;
    }

    public void setGainBusinessFund(String gainBusinessFund) {
        this.gainBusinessFund = gainBusinessFund;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public String getEntrustTagDesc() {
        return entrustTagDesc;
    }

    public void setEntrustTagDesc(String entrustTagDesc) {
        this.entrustTagDesc = entrustTagDesc;
    }

    public String getBusinessFund() {
        return businessFund;
    }

    public void setBusinessFund(String businessFund) {
        this.businessFund = businessFund;
    }

    public String getManagementFund() {
        return managementFund;
    }

    public void setManagementFund(String managementFund) {
        this.managementFund = managementFund;
    }

    public String getCommissionFund() {
        return commissionFund;
    }

    public void setCommissionFund(String commissionFund) {
        this.commissionFund = commissionFund;
    }

    public String getTotalBusinessFund() {
        return totalBusinessFund;
    }

    public void setTotalBusinessFund(String totalBusinessFund) {
        this.totalBusinessFund = totalBusinessFund;
    }
}
